import React, { useContext } from "react";
import NodeCard from "./render/NodeCard"
import { Box, Flex, FormLabel, TextareaProps } from "@chakra-ui/react";
// import WelcomeTextConfig from "@/components/core/app/WelcomeTextConfig";
import { Handle, Position } from "reactflow";
import MyTextarea from "@/components/common/Textarea/MyTextarea";
import { AppDetailContext } from "@/context/app/detail/appDetailContext";
import MyIcon from "@/components/common/Icon/MyIcon";

const NodeUserGuide = ({ data, selected }:any)=>{
    console.log(data,selected)
    // const Header = ()=>{
    //     return (
    //         <Box position={'relative'}>
    //              <Box px={4} py={3}>
    //                 <div>
    //                     <h1>{data.title}</h1>
    //                     <p>{data.description}</p>
    //                 </div>
    //              </Box>
    //         </Box>
    //     )
    // }
    const {chatConfig} = useContext(AppDetailContext);

    console.log('NodeUserGuide',data);
    return (
        <>
            <NodeCard
                selected={selected}
                minW={'300px'}
                {...data}
                menuForbid={{
                    debug: true,
                    rename: true,
                    copy: true,
                    delete: true}}
            >
                  <Box px={4} py={'10px'} position={'relative'} borderRadius={'md'} className="nodrag">
                         <WelcomeText {...data} />
                  </Box>
            </NodeCard>
        </>
    )
}


const WelcomeText = (props: TextareaProps) => {
    return (
        <Box className="nodrag">
          <Flex alignItems={'center'}>
            <FormLabel ml={2}>对话开场白</FormLabel>
          </Flex>   
          <MyTextarea
            bg={'myWhite.400'}
            rows={6}
            fontSize={'sm'}
            placeholder= 'Welcome to the world of coding. Write your first line here.'
            {...props}
            />
        </Box>
    )
}


export default React.memo(NodeUserGuide);